package com.ailargemodel.controller;

import com.ailargemodel.common.BaseResponse;
import com.ailargemodel.pojo.User;
import com.ailargemodel.service.RankListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin("*")
@RestController
@RequestMapping("/rank")
public class RankListController {
    @Autowired
    private RankListService rankListService;

    @GetMapping("/list")
    public BaseResponse rankList() {
        BaseResponse baseResponse = rankListService.getRankList();
        return baseResponse;
    }

    @PostMapping ("/singlerank")
    public BaseResponse getSingleRank(@RequestBody  User user) {
        BaseResponse baseResponse = rankListService.getSingleRank(user);
        return baseResponse;
    }
}
